﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
namespace INTEX.DataBase.Tools
{
    public partial class INTEXDBC
    {
        #region======A==============
        public void DeleteABARTE(string client, string krs, string lfd, string pos, int option = 1)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM ABARTE WHERE  "
               + "  ABEMANDANT=:ABEMANDANT AND ABEAUFKRS=:ABEAUFKRS AND ABEAUFLFD=:ABEAUFLFD AND ABEAUFPOS=:ABEAUFPOS ";
                    or1.Parameters.Add("ABEMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("ABEAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("ABEAUFLFD", OracleType.NVarChar).Value = lfd;
                    or1.Parameters.Add("ABEAUFPOS", OracleType.NVarChar).Value = pos;
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
        public void DeleteABFOLGE(string client, string krs, string lfd, string pos, int option = 1)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM ABFOLGE WHERE  "
               + "  ABFMANDANT=:ABFMANDANT AND ABFAUFKRS=:ABFAUFKRS AND ABFAUFLFD=:ABFAUFLFD AND ABFAUFPOS=:ABFAUFPOS";
                    or1.Parameters.Add("ABFMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("ABFAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("ABFAUFLFD", OracleType.NVarChar).Value = lfd;
                    or1.Parameters.Add("ABFAUFPOS", OracleType.NVarChar).Value = pos;
                    break;
                case 2:
                    or1.CommandText = "DELETE FROM ABFOLGE WHERE  "
               + "  ABFMANDANT=:ABFMANDANT AND ABFAUFKRS=:ABFAUFKRS AND ABFAUFLFD=:ABFAUFLFD";
                    or1.Parameters.Add("ABFMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("ABFAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("ABFAUFLFD", OracleType.NVarChar).Value = lfd;
                    break;
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
        public void DeleteABPOS(string client, string krs, string lfd, string pos, int option = 1)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM ABPOS WHERE  "
          + "  ABPMANDANT=:ABPMANDANT AND ABPAUFKRS=:ABPAUFKRS AND ABPAUFLFD=:ABPAUFLFD AND ABPAUFPOS=:ABPAUFPOS";
                    or1.Parameters.Add("ABPMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("ABPAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("ABPAUFLFD", OracleType.NVarChar).Value = lfd;
                    or1.Parameters.Add("ABPAUFPOS", OracleType.NVarChar).Value = pos;
                    break;
                case 2:
                    or1.CommandText = "DELETE FROM ABPOS WHERE  "
          + "  ABPMANDANT=:ABPMANDANT AND ABPAUFKRS=:ABPAUFKRS AND ABPAUFLFD=:ABPAUFLFD ";
                    or1.Parameters.Add("ABPMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("ABPAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("ABPAUFLFD", OracleType.NVarChar).Value = lfd;

                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }

        public void DeleteABPR(string client, string krs, string lfd, string pos, int option = 1)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM ABPR WHERE  "
      + "  ARMANDANT=:ARMANDANT AND ARAUFKRS=:ARAUFKRS AND ARAUFLFD=:ARAUFLFD AND ARAUFPOS=:ARAUFPOS";
                    or1.Parameters.Add("ARMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("ARAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("ARAUFLFD", OracleType.NVarChar).Value = lfd;
                    or1.Parameters.Add("ARAUFPOS", OracleType.NVarChar).Value = pos;
                    break;
                case 2:
                    or1.CommandText = "DELETE FROM ABPR WHERE  "
      + "  ARMANDANT=:ARMANDANT AND ARAUFKRS=:ARAUFKRS AND ARAUFLFD=:ARAUFLFD";
                    or1.Parameters.Add("ARMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("ARAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("ARAUFLFD", OracleType.NVarChar).Value = lfd;

                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
        public void DeleteABKOPF(string client, string krs, string lfd)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE FROM ABKOPF WHERE  "
                      + "  ABKMANDANT=:ABKMANDANT AND ABKAUFKRS=:ABKAUFKRS AND ABKAUFLFD=:ABKAUFLFD";
            or1.Parameters.Add("ABKMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("ABKAUFKRS", OracleType.NVarChar).Value = krs;
            or1.Parameters.Add("ABKAUFLFD", OracleType.NVarChar).Value = lfd;
            Connect2Proxy(or1);
        }
        public void DeleteABAUFM(string client, string krs, string lfd, string pos, int option = 1)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM ABAUFM WHERE  "
          + "  ABAMANDANT=:ABAMANDANT AND ABAAUFKRS=:ABAAUFKRS AND ABAAUFLFD=:ABAAUFLFD AND ABAAUFPOS=:ABAAUFPOS";
                    or1.Parameters.Add("ABAMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("ABAAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("ABAAUFLFD", OracleType.NVarChar).Value = lfd;
                    or1.Parameters.Add("ABAAUFPOS", OracleType.NVarChar).Value = pos;
                    break;
                case 2:
                    or1.CommandText = "DELETE FROM ABAUFM WHERE  "
          + "  ABAMANDANT=:ABAMANDANT AND ABAAUFKRS=:ABAAUFKRS AND ABAAUFPOS=:ABAAUFPOS ";
                    or1.Parameters.Add("ABAMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("ABAAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("ABAAUFLFD", OracleType.NVarChar).Value = lfd;

                    break;
                default:
                    break;
            }

            Connect2Proxy(or1);
        }
        public void DeleteABAUFM(DataRow dwData, int option = 1)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM ABAUFM WHERE  "
                        + "  ABAMANDANT=:ABAMANDANT AND ABAAUFKRS=:ABAAUFKRS AND ABAAUFLFD=:ABAAUFLFD AND ABAAUFPOS=:ABAAUFPOS";
                    or1.Parameters.Add("ABAMANDANT", OracleType.NVarChar).Value = dwData["ABAMANDANT"];
                    or1.Parameters.Add("ABAAUFKRS", OracleType.NVarChar).Value = dwData["ABAAUFKRS"];
                    or1.Parameters.Add("ABAAUFLFD", OracleType.NVarChar).Value = dwData["ABAAUFLFD"];
                    or1.Parameters.Add("ABAAUFPOS", OracleType.NVarChar).Value = dwData["ABAAUFPOS"];
                    or1.Parameters.Add("ABAAPOS", OracleType.NVarChar).Value = dwData["ABAAPOS"];
                    break; 
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
        public void DeleteICC_ABPOS_MAT(DataRow dwData, int option = 1)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM ICC_ABPOS_MAT WHERE  ABID=:ABID ";
                    or1.Parameters.Add("ABID", OracleType.NVarChar).Value = dwData["ABID"]; 
                    break;
                case 2:
                    or1.CommandText = "DELETE FROM ICC_ABPOS_MAT WHERE  "
                        + "  KRS=:KRS AND LFD=:LFD AND ART=:ART ";
                    or1.Parameters.Add("KRS", OracleType.NVarChar).Value = dwData["KRS"];
                    or1.Parameters.Add("LFD", OracleType.NVarChar).Value = dwData["LFD"];
                    or1.Parameters.Add("ART", OracleType.NVarChar).Value = dwData["ART"]; 
                    break;
                case 3:
                    or1.CommandText = "DELETE FROM ICC_ABPOS_MAT WHERE  "
                        + "  KRS=:KRS AND LFD=:LFD ";
                    or1.Parameters.Add("KRS", OracleType.NVarChar).Value = dwData["KRS"];
                    or1.Parameters.Add("LFD", OracleType.NVarChar).Value = dwData["LFD"];
                    break; 
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
        public void DeleteICC_ABAUFM(string client, string krs, string lfd, string pos, DataRow dwData = null, int option = 1)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM ICC_ABAUFM WHERE  "
          + "  ABAMANDANT=:ABAMANDANT AND ABAVKAUFKRS=:ABAVKAUFKRS AND ABAVKAUFLFD=:ABAVKAUFLFD AND ABAVKAUFPOS=:ABAVKAUFPOS";
                    or1.Parameters.Add("ABAMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("ABAVKAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("ABAVKAUFLFD", OracleType.NVarChar).Value = lfd;
                    or1.Parameters.Add("ABAVKAUFPOS", OracleType.NVarChar).Value = pos;
                    break;
                case 2:
                    or1.CommandText = "DELETE FROM ICC_ABAUFM WHERE  "
          + "  ABAMANDANT=:ABAMANDANT AND ABAVKAUFKRS=:ABAVKAUFKRS AND ABAVKAUFLFD=:ABAVKAUFLFD ";
                    or1.Parameters.Add("ABAMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("ABAVKAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("ABAVKAUFLFD", OracleType.NVarChar).Value = lfd;

                    break;
                case 3:
                    or1.CommandText = "DELETE FROM  ICC_ABAUFM  "
                    + " WHERE ABAMANDANT=:ABAMANDANT AND ABAVKAUFKRS=:ABAVKAUFKRS AND ABAVKAUFLFD=:ABAVKAUFLFD AND .ABAVKAUFPOS=:ABAVKAUFPOS AND  TRIM(ABAVKUPOS)=:ABAVKUPOS";
                    or1.Parameters.Add("ABAMANDANT", OracleType.NVarChar).Value = dwData["ABAMANDANT"].ToString();
                    or1.Parameters.Add("ABAVKAUFKRS", OracleType.NVarChar).Value = dwData["ABAVKAUFKRS"].ToString();
                    or1.Parameters.Add("ABAVKAUFLFD", OracleType.NVarChar).Value = dwData["ABAVKAUFLFD"].ToString();
                    or1.Parameters.Add("ABAVKAUFPOS", OracleType.NVarChar).Value = dwData["ABAVKAUFPOS"].ToString();
                    or1.Parameters.Add("ABAVKUPOS", OracleType.NVarChar).Value = dwData["ABAVKUPOS"].ToString().Trim();
                    break;
                case 4:
                    or1.CommandText = "DELETE FROM ICC_ABAUFM  "
                    + " WHERE ABAID=:ABAID";
                    or1.Parameters.Add("ABAID", OracleType.NVarChar).Value = dwData["ABAID"].ToString();
                    break; 
                default:
                    break;
            }
            Connect2Proxy(or1);
        }

        public void DeleteICC_ABPOSFS(string client, string krs, string lfd)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE FROM ICC_ABPOSFS WHERE  "
                      + "   KRS=:KRS AND  LFD=:LFD ";
            or1.Parameters.Add("KRS", OracleType.NVarChar).Value = krs;
            or1.Parameters.Add("LFD", OracleType.NVarChar).Value = lfd;
            Connect2Proxy(or1);
        }
        #endregion

        #region======B==============

        public void DeleteBABST(string client, string krs, string lfd, string pos, int option = 1)
        {
            OracleCommand or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = " DELETE BABST "
                + "  WHERE BMMANDANT=:BMMANDANT AND BMAUFKRS=:BMAUFKRS AND BMAUFLFD=:BMAUFLFD AND BMAUFPOS=:BMAUFPOS";
                    or1.Parameters.Add("BMMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("BMAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("BMAUFLFD", OracleType.NVarChar).Value = lfd;
                    or1.Parameters.Add("BMAUFPOS", OracleType.NVarChar).Value = pos;
                    break;
                case 2:
                    or1.CommandText = " DELETE BABST "
                + "  WHERE GAMANDANT=:BMMANDANT AND BMAUFKRS=:BMAUFKRS AND BMAUFLFD=:BMAUFLFD ";
                    or1.Parameters.Add("BMMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("BMAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("BMAUFLFD", OracleType.NVarChar).Value = lfd;

                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
            public void DeleteBAAUF(string client, string krs, string lfd, string pos, int option = 1)
        {
            OracleCommand or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = " DELETE BAAUF "
                + "  WHERE BAMANDANT=:BAMANDANT AND BAAUFKRS=:BAAUFKRS AND BAAUFLFD=:BAAUFLFD AND BAAUFPOS=:BAAUFPOS";
                    or1.Parameters.Add("BAMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("BAAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("BAAUFLFD", OracleType.NVarChar).Value = lfd;
                    or1.Parameters.Add("BAAUFPOS", OracleType.NVarChar).Value = pos;
                    break;
                case 2:
                    or1.CommandText = " DELETE BAAUF "
                + "  WHERE GAMANDANT=:BAMANDANT AND BAAUFKRS=:BAAUFKRS AND BAAUFLFD=:BAAUFLFD ";
                    or1.Parameters.Add("BAMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("BAAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("BAAUFLFD", OracleType.NVarChar).Value = lfd;

                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
        public void DeleteBSSATZ(string client, string art)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE  BSSATZ"
           + " WHERE "
            + " BSMANDANT=:BSMANDANT AND BSKART=:BSKART";
            or1.Parameters.Add("BSMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("BSKART", OracleType.NVarChar).Value = art;
            Connect2Proxy(or1);
        }
        public void DeleteBHSATZ(string client, string art, string var)
        {

            OracleCommand or1;

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE BHSATZ"
           + " WHERE BHMANDANT=:BHMANDANT AND BHKART=:BHKART AND BHKVAR=:BHKVAR";
            or1.Parameters.Add("BHMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("BHKART", OracleType.NVarChar).Value = art;
            or1.Parameters.Add("BHKVAR", OracleType.NVarChar).Value = var;
            Connect2Proxy(or1);
        }
        public void DeleteBSGROE(string client, string art)
        {

            OracleCommand or1;

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE  BSGROE"
           + " WHERE "
            + " BSGMANDANT=:BSGMANDANT AND BSGART=:BSGART";
            or1.Parameters.Add("BSGMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("BSGART", OracleType.NVarChar).Value = art;
            Connect2Proxy(or1);
        }
        public void DeleteBSFARB(string client, string art, string var, string color)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE BSFARB"
           + " WHERE BSFMANDANT=:BSFMANDANT AND BSFKART=:BSFKART AND BSFKVAR=:BSFKVAR AND BSFKFARBE=:BSFKFARBE";
            or1.Parameters.Add("BSFMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("BSFKART", OracleType.NVarChar).Value = art;
            or1.Parameters.Add("BSFKVAR", OracleType.NVarChar).Value = var;
            or1.Parameters.Add("BSFKFARBE", OracleType.NVarChar).Value = color;
            Connect2Proxy(or1);
        }
        public void DeleteBASTGA(string client, string art, string var, string color)
        {

            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE BASTGA WHERE  "
            + "  BAGMANDANT=:BAGMANDANT AND BAGART=:BAGART AND BAGVAR=:BAGVAR AND BAGFARBE=:BAGFARBE";
            or1.Parameters.Add("BAGMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("BAGART", OracleType.NVarChar).Value = art;
            or1.Parameters.Add("BAGVAR", OracleType.NVarChar).Value = var;
            or1.Parameters.Add("BAGFARBE", OracleType.NVarChar).Value = color;
            Connect2Proxy(or1);
        }
        public void DeleteBASTGAD(string client, string art, string var, string color)
        {

            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE BASTGAD WHERE  "
            + "  BAGMANDANT=:BAGMANDANT AND BAGART=:BAGART AND BAGVAR=:BAGVAR AND BAGFARBE=:BAGFARBE";
            or1.Parameters.Add("BAGMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("BAGART", OracleType.NVarChar).Value = art;
            or1.Parameters.Add("BAGVAR", OracleType.NVarChar).Value = var;
            or1.Parameters.Add("BAGFARBE", OracleType.NVarChar).Value = color;
            Connect2Proxy(or1);
        }
        #endregion

        #region======C==============
        #endregion

        #region======D==============
        #endregion

        #region======E==============
        public void DeleteEKPOS(string client, string krs, string lfd, string pos)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            or1.CommandText = " DELETE EKPOS "
            + " WHERE EKPMANDANT=:EKPMANDANT   AND EKPAUFKRS=:EKPAUFKRS  AND EKPAUFLFD=:EKPAUFLFD AND EKPAUFPOS=:EKPAUFPOS";
            or1.Parameters.Add("EKPMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("EKPAUFKRS", OracleType.NVarChar).Value = krs;
            or1.Parameters.Add("EKPAUFLFD", OracleType.NVarChar).Value = lfd;
            or1.Parameters.Add("EKPAUFPOS", OracleType.NVarChar).Value = pos;
            Connect2Proxy(or1);
        }
        public void DeleteEKKOPF(string client, string krs, string lfd)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            or1.CommandText = " DELETE EKKOPF "
            + " WHERE EKKMANDANT=:EKKMANDANT   AND EKKAUFKRS=:EKKAUFKRS  AND EKKAUFLFD=:EKKAUFLFD";
            or1.Parameters.Add("EKKMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("EKKAUFKRS", OracleType.NVarChar).Value = krs;
            or1.Parameters.Add("EKKAUFLFD", OracleType.NVarChar).Value = lfd;
            Connect2Proxy(or1);
        }
        #endregion

        #region======F==============
        public void DeleteFDECK(string client, string krs, string lfd, string pos, string step = "", string setpos = "", int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = " DELETE FDECK "
                        + " WHERE FDMANDANT=:FDMANDANT   AND FDAUFKRS=:FDAUFKRS  AND FDAUFLFD=:FDAUFLFD AND FDAUFPOS=:FDAUFPOS";
                    or1.Parameters.Add("FDMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("FDAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("FDAUFLFD", OracleType.NVarChar).Value = lfd;
                    or1.Parameters.Add("FDAUFPOS", OracleType.NVarChar).Value = pos;
                    break;
                case 2:
                    or1.CommandText = " DELETE FDECK "
                        + " WHERE FDMANDANT=:FDMANDANT   AND FDAUFKRS=:FDAUFKRS  AND FDAUFLFD=:FDAUFLFD ";
                    or1.Parameters.Add("FDMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("FDAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("FDAUFLFD", OracleType.NVarChar).Value = lfd;
                    break;
                case 3:
                    or1.CommandText = " DELETE FDECK "
                        + " WHERE FDMANDANT=:FDMANDANT   AND FDAUFKRS=:FDAUFKRS  AND FDAUFLFD=:FDAUFLFD  AND FDAUFPOS=:FDAUFPOS AND FDAFOLGE=:FDAFOLGE AND FDSETPOS=:FDSETPOS";
                    or1.Parameters.Add("FDMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("FDAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("FDAUFLFD", OracleType.NVarChar).Value = lfd;
                    or1.Parameters.Add("FDAUFPOS", OracleType.NVarChar).Value = pos;
                    or1.Parameters.Add("FDAFOLGE", OracleType.NVarChar).Value = step;
                    or1.Parameters.Add("FDSETPOS", OracleType.NVarChar).Value = setpos;
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
        public void DeleteFDECK(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = " DELETE FROM FDECK "
                        + " WHERE FDMANDANT=:FDMANDANT   AND FDAUFKRS=:FDAUFKRS  AND FDAUFLFD=:FDAUFLFD AND FDAUFPOS=:FDAUFPOS AND FDART=:FDART";
                    or1.Parameters.Add("FDMANDANT", OracleType.NVarChar).Value = dwData["FDMANDANT"];
                    or1.Parameters.Add("FDAUFKRS", OracleType.NVarChar).Value = dwData["FDAUFKRS"];
                    or1.Parameters.Add("FDAUFLFD", OracleType.NVarChar).Value = dwData["FDAUFLFD"];
                    or1.Parameters.Add("FDAUFPOS", OracleType.NVarChar).Value = dwData["FDAUFPOS"];
                    or1.Parameters.Add("FDART", OracleType.NVarChar).Value = dwData["FDART"];
                    break;
                case 2:
                    or1.CommandText = " DELETE FROM FDECK WHERE "
                   + "  FDMANDANT=:FDMANDANT  AND FDAUFKRS=:FDAUFKRS AND FDAUFLFD=:FDAUFLFD"
                        + " AND FDAUFPOS=:FDAUFPOS AND FDART=:FDART AND FDVAR=:FDVAR AND FDFARBE=:FDFARBE AND FDGROE=:FDGROE ";
                    or1.Parameters.Add("FDMANDANT", OracleType.NVarChar).Value = dwData["FDMANDANT"].ToString();
                    or1.Parameters.Add("FDAUFKRS", OracleType.NVarChar).Value = dwData["FDAUFKRS"].ToString();
                    or1.Parameters.Add("FDAUFLFD", OracleType.NVarChar).Value = dwData["FDAUFLFD"].ToString();
                    or1.Parameters.Add("FDAUFPOS", OracleType.NVarChar).Value = dwData["FDAUFPOS"].ToString();

                    or1.Parameters.Add("FDART", OracleType.NVarChar).Value = dwData["FDART"].ToString();
                    or1.Parameters.Add("FDVAR", OracleType.NVarChar).Value = dwData["FDVAR"].ToString();
                    or1.Parameters.Add("FDFARBE", OracleType.NVarChar).Value = dwData["FDFARBE"].ToString();
                    or1.Parameters.Add("FDGROE", OracleType.NVarChar).Value = dwData["FDGROE"].ToString();
                    break; 
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
        public void DeleteFSSTUELI(string client, string art, string pos, int option = 1)
        {
            OracleCommand or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = " DELETE FSSTUELI "
                        + " WHERE FSSMANDANT=:FSSMANDANT   AND FSSART=:FSSART and FSSPOS=:FSSPOS   ";
                    or1.Parameters.Add("FSSMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("FSSART", OracleType.NVarChar).Value = art;
                    or1.Parameters.Add("FSSPOS", OracleType.NVarChar).Value = pos;
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
        public void DeleteFBST(DataRow dwData, int option = 1)
        {
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = " DELETE FROM FBST "
                       + " WHERE FBMANDANT=:FBMANDANT AND FBCHAR=:FBCHAR AND FBLO=:FBLO AND FBLB=:FBLB AND FBLP=:FBLP ";
                    or1.Parameters.Add("FBMANDANT", OracleType.NVarChar).Value = dwData["FBMANDANT"];
                    or1.Parameters.Add("FBCHAR", OracleType.NVarChar).Value = dwData["FBCHAR"];
                    or1.Parameters.Add("FBLO", OracleType.NVarChar).Value = dwData["FBLO"];
                    or1.Parameters.Add("FBLB", OracleType.NVarChar).Value = dwData["FBLB"];
                    or1.Parameters.Add("FBLP", OracleType.NVarChar).Value = dwData["FBLP"]; 
                    break; 
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
        
        #endregion

        #region======G==============

        public void DeleteGAAUF(string client, string krs, string lfd, string pos, int option = 1)
        {
            OracleCommand or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = " DELETE GAAUF "
                + "  WHERE GAMANDANT=:GAMANDANT AND GAAUFKRS=:GAAUFKRS AND GAAUFLFD=:GAAUFLFD AND GAAUFPOS=:GAAUFPOS";
                    or1.Parameters.Add("GAMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("GAAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("GAAUFLFD", OracleType.NVarChar).Value = lfd;
                    or1.Parameters.Add("GAAUFPOS", OracleType.NVarChar).Value = pos;
                    break;
                case 2:
                    or1.CommandText = " DELETE GAAUF "
                + "  WHERE GAMANDANT=:GAMANDANT AND GAAUFKRS=:GAAUFKRS AND GAAUFLFD=:GAAUFLFD ";
                    or1.Parameters.Add("GAMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("GAAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("GAAUFLFD", OracleType.NVarChar).Value = lfd;

                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
        #endregion

        #region======H==============
        #endregion

        #region======K==============
        //KDSTAMM KUNDVER
        #endregion

        #region======L==============
        #endregion

        #region======M==============
        public void DeleteMDECK(string client, string krs, string lfd, string pos, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = " DELETE MDECK "
            + " WHERE MDMANDANT=:MDMANDANT  AND MDAUFKRS=:MDAUFKRS  AND MDAUFLFD=:MDAUFLFD AND MDAUFPOS=:MDAUFPOS";
                    or1.Parameters.Add("MDMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("MDAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("MDAUFLFD", OracleType.NVarChar).Value = lfd;
                    or1.Parameters.Add("MDAUFPOS", OracleType.NVarChar).Value = pos;
                    break;
                case 2:
                    or1.CommandText = " DELETE MDECK "
            + " WHERE MDMANDANT=:MDMANDANT  AND MDAUFKRS=:MDAUFKRS  AND MDAUFLFD=:MDAUFLFD ";
                    or1.Parameters.Add("MDMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("MDAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("MDAUFLFD", OracleType.NVarChar).Value = lfd;

                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }

        #endregion

        #region======P==============
        #endregion

        #region======Q==============

        public void DeleteQPZUORD(string client, string stage, string art, string var)
        {
            OracleCommand or1 = OracleDB.CreateCommand();
            or1.CommandText = " DELETE QPZUORD "
                        + " WHERE QPZMANDANT=:QPZMANDANT  AND QPZARTST=:QPZARTST AND QPZART=:QPZART  AND QPZVAR=:QPZVAR";
            or1.Parameters.Add("QPZMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("QPZARTST", OracleType.NVarChar).Value = stage;
            or1.Parameters.Add("QPZART", OracleType.NVarChar).Value = art;
            or1.Parameters.Add("QPZVAR", OracleType.NVarChar).Value = var;
            Connect2Proxy(or1);
        }
        #endregion

        #region=====S==============
        public void DeleteSDDAT(string sdkey, string key)
        {

            OracleCommand or1 = OracleDB.CreateCommand();

            string SDKEY = "00" + Left(key + "                       ", 21) + "V";
            or1.CommandText = " SELECT * "
            + " FROM SDDAT WHERE SDSA=:SDSA AND SDKEY =:SDKEY";
            or1.Parameters.Add("SDSA", OracleType.NVarChar).Value = sdkey;
            or1.Parameters.Add("SDKEY", OracleType.NVarChar).Value = SDKEY;
            Connect2Proxy(or1);
        }
        #endregion

        #region======W==============

        public void DeleteWDECK(string client, string krs, string lfd, string pos, string upos = "", int option = 1)
        {
            OracleCommand or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = " DELETE WDECK "
   + " WHERE WDMANDANT=:WDMANDANT AND WDAUFKRS=:WDAUFKRS  AND WDAUFLFD=:WDAUFLFD AND WDAUFPOS=:WDAUFPOS";
                    or1.Parameters.Add("WDMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("WDAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("WDAUFLFD", OracleType.NVarChar).Value = lfd;
                    or1.Parameters.Add("WDAUFPOS", OracleType.NVarChar).Value = pos;
                    break;
                case 2:
                    or1.CommandText = " DELETE WDECK "
   + " WHERE WDMANDANT=:WDMANDANT AND WDAUFKRS=:WDAUFKRS  AND WDAUFLFD=:WDAUFLFD ";
                    or1.Parameters.Add("WDMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("WDAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("WDAUFLFD", OracleType.NVarChar).Value = lfd;
                    break;
                case 3:
                    or1.CommandText = " DELETE WDECK "
   + " WHERE WDMANDANT=:WDMANDANT AND WDAUFKRS=:WDAUFKRS  AND WDAUFLFD=:WDAUFLFD AND WDAUFPOS=:WDAUFPOS AND WDUPOS=:WDUPOS ";
                    or1.Parameters.Add("WDMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("WDAUFKRS", OracleType.NVarChar).Value = krs;
                    or1.Parameters.Add("WDAUFLFD", OracleType.NVarChar).Value = lfd;
                    or1.Parameters.Add("WDAUFPOS", OracleType.NVarChar).Value = pos;
                    or1.Parameters.Add("WDUPOS", OracleType.NVarChar).Value = upos;
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }

        public void DeleteWBBST(string sdkey, string key)
        {

            OracleCommand or1 = OracleDB.CreateCommand();

            string SDKEY = "00" + Left(key + "                       ", 21) + "V";
            or1.CommandText = " SELECT * "
            + " FROM SDDAT WHERE SDSA=:SDSA AND SDKEY =:SDKEY";
            or1.Parameters.Add("SDSA", OracleType.NVarChar).Value = sdkey;
            or1.Parameters.Add("SDKEY", OracleType.NVarChar).Value = SDKEY;
            Connect2Proxy(or1);
        }
        public void DeleteWBBEW(string sdkey, string key)
        {

            OracleCommand or1 = OracleDB.CreateCommand();

            string SDKEY = "00" + Left(key + "                       ", 21) + "V";
            or1.CommandText = " SELECT * "
            + " FROM SDDAT WHERE SDSA=:SDSA AND SDKEY =:SDKEY";
            or1.Parameters.Add("SDSA", OracleType.NVarChar).Value = sdkey;
            or1.Parameters.Add("SDKEY", OracleType.NVarChar).Value = SDKEY;
            Connect2Proxy(or1);
        }

        public void DeleteWASTAMM(string client, string art, string var)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE WASTAMM WHERE  "
            + "  WAMANDANT=:WAMANDANT AND WAART=:WAART AND WAVAR=:WAVAR";
            or1.Parameters.Add("WAMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("WAART", OracleType.NVarChar).Value = art;
            or1.Parameters.Add("WAVAR", OracleType.NVarChar).Value = var;
            Connect2Proxy(or1);
        }
        public void DeleteWTSCHUSS(string client, string art)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE WTSCHUSS WHERE WTSMANDANT=:WTSMANDANT AND WTSSFLGNR=':WTSSFLGNR";
            or1.Parameters.Add("WTSMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("WTSSFLGNR", OracleType.NVarChar).Value = art;
            Connect2Proxy(or1);
        }
        public void DeleteWAFARBEN(string client, string art, string var, string color)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE WAFARBEN WHERE   "
                + "  WAFMANDANT=:WAFMANDANT AND WAFART=:WAFART AND WAFVAR=:WAFVAR AND WAFZUSATZ=:WAFZUSATZ";
            or1.Parameters.Add("WAFMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("WAFART", OracleType.NVarChar).Value = art;
            or1.Parameters.Add("WAFVAR", OracleType.NVarChar).Value = var;
            or1.Parameters.Add("WAFZUSATZ", OracleType.NVarChar).Value = color;

            Connect2Proxy(or1);
        }
        public void DeleteWTEINZ(string client, string art)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE WTEINZ WHERE WTEMANDANT=:WTEMANDANT AND WTEEINZNR=:WTEEINZNR";
            or1.Parameters.Add("WTEMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("WTEEINZNR", OracleType.NVarChar).Value = art;
            Connect2Proxy(or1);
        }

        public void DeleteWASTPASS(string client, string art, string var)
        {
            OracleCommand or1;

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE WASTPASS WHERE   "
            + "  WSPMANDANT=:WSPMANDANT AND WSPART=:WSPART AND WSPVAR=:WSPVAR";
            or1.Parameters.Add("WSPMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("WSPART", OracleType.NVarChar).Value = art;
            or1.Parameters.Add("WSPVAR", OracleType.NVarChar).Value = var;
            Connect2Proxy(or1);
        }
        public void DeleteWTPASS(string client, string art)
        {

            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE WTPASS WHERE   "
            + "  WTPMANDANT=:WTPMANDANT AND WTPPASSNR=:WTPPASSNR";
            or1.Parameters.Add("WTPMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("WTPPASSNR", OracleType.NVarChar).Value = art;
            Connect2Proxy(or1);
        }
        public void DeleteWTSAER(string client, string art)
        {

            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE WTSAER WHERE   "
            + "  WTBMANDANT=:WTBMANDANT AND WTBSRFNR=:WTBSRFNR";
            or1.Parameters.Add("WTBMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("WTBSRFNR", OracleType.NVarChar).Value = art;
            Connect2Proxy(or1);
        }

        public void DeleteWTGEW(string client, string art, string var)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE WTGEW WHERE   "
            + "  WTGMANDANT=:WTGMANDANT AND WTGART=:WTGART AND WTGVAR=:WTGVAR";
            or1.Parameters.Add("WTGMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("WTGART", OracleType.NVarChar).Value = art;
            or1.Parameters.Add("WTGVAR", OracleType.NVarChar).Value = var;
            Connect2Proxy(or1);
        }
        public void DeleteWASTKE(string client, string art, string var, string color)
        {

            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE WASTKE"
           + " WHERE WAKMANDANT=:WAKMANDANT AND WAKART=:WAKART AND WAKVAR=:WAKVAR AND WAKWCOL=:WAKWCOL";
            or1.Parameters.Add("WAKMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("WAKART", OracleType.NVarChar).Value = art;
            or1.Parameters.Add("WAKVAR", OracleType.NVarChar).Value = var;
            or1.Parameters.Add("WAKWCOL", OracleType.NVarChar).Value = color;
            Connect2Proxy(or1);
        }
        public void DeleteWASTGA(string client, string art, string var, string color)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE WASTGA WHERE  "
            + "  WAGMANDANT=:WAGMANDANT AND WAGART=:WAGART AND WAGVAR=:WAGVAR AND WAGWCOL=:WAGWCOL";
            or1.Parameters.Add("WAGMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("WAGART", OracleType.NVarChar).Value = art;
            or1.Parameters.Add("WAGVAR", OracleType.NVarChar).Value = var;
            or1.Parameters.Add("WAGWCOL", OracleType.NVarChar).Value = color;
            Connect2Proxy(or1);
        }
        #endregion

        #region======V==============
        //WDECK WBBST WBBEW VVLIEF VVTLIEF
        public void DeleteVVLIEF(string sdkey, string key)
        {

            OracleCommand or1 = OracleDB.CreateCommand();

            string SDKEY = "00" + Left(key + "                       ", 21) + "V";
            or1.CommandText = " SELECT * "
            + " FROM SDDAT WHERE SDSA=:SDSA AND SDKEY =:SDKEY";
            or1.Parameters.Add("SDSA", OracleType.NVarChar).Value = sdkey;
            or1.Parameters.Add("SDKEY", OracleType.NVarChar).Value = SDKEY;
            Connect2Proxy(or1);
        }
        public void DeleteVVTLIEF(string sdkey, string key)
        {

            OracleCommand or1 = OracleDB.CreateCommand();

            string SDKEY = "00" + Left(key + "                       ", 21) + "V";
            or1.CommandText = " SELECT * "
            + " FROM SDDAT WHERE SDSA=:SDSA AND SDKEY =:SDKEY";
            or1.Parameters.Add("SDSA", OracleType.NVarChar).Value = sdkey;
            or1.Parameters.Add("SDKEY", OracleType.NVarChar).Value = SDKEY;
            Connect2Proxy(or1);
        }
        #endregion
        #region===ICC============
        //ICC_FOLDERS;ICC_MENUDEF; ICC_FUNCTIONS
        public void DeleteICC_FUNCTIONS(string client)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE FROM ICC_FUNCTIONS"
         + " WHERE MANDANT=:MANDANT";
            or1.Parameters.Add("MANDANT", OracleType.NVarChar).Value = client;
            Connect2Proxy(or1);
        }
        public void DeleteICC_FOLDERS(string client, string company)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE FROM ICC_FOLDERS"
         + " WHERE MANDANT=:MANDANT";
            or1.Parameters.Add("MANDANT", OracleType.NVarChar).Value = client;
            Connect2Proxy(or1);
        }
        public void DeleteICC_MENUDEF(string client, string company, string userid)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE FROM ICC_MENUDEF"
         + " WHERE MANDANT=:MANDANT AND COMPANY=:COMPANY AND USERID=:USERID";
            or1.Parameters.Add("MANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("COMPANY", OracleType.NVarChar).Value = company;
            or1.Parameters.Add("USERID", OracleType.NVarChar).Value = userid; 
            Connect2Proxy(or1);
        }
        public void DeleteICC_MENUDEF(DataRow dwData,int option=1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            { 
                case 1:
                    or1.CommandText = "DELETE FROM ICC_MENUDEF  WHERE PROCESS='HIDDEN'";         
                    break;
                default:
                    break;
            }
       
            Connect2Proxy(or1);
        }
        #endregion

    }
}
